<template>
	<view class="page">
		<view class="content">
			<view class="content-left">
				<image class="img" src="https://images.linglinggong.net/static/icon1/fanhui.png" mode="" @click="back ">
				</image>
				<swiper class="content-swiper" autoplay='true' vertical='true' circular='true' duration=1200
					style="display: none;">
					<swiper-item v-for="(item,index) in list" :key="index">
						<view class="content-swiper-item">
							<view class="">
								{{item}}
							</view>
						</view>
					</swiper-item>
				</swiper>
			</view>
			<!-- 总金额 -->
			<view class="content-amount">
				{{content.amount||0 }}
			</view>
			<view class="content-title">
				<view class="content-title-tip">
					<view class="">规则</view>
					<view class="">
						<view class=""> 完成订单工时需要>=6小时 </view>
						<view class=""> 红包活动只持续1个月 </view>
					</view>
				</view>
				<view class="content-title-pro">
					<view class=""> 已获得红包 </view>
					<view class=""> {{content.obtainedAmount||0 }} </view>
					<view class=""> 最低可提现额度：{{content.minimum||0}}元 </view>
				</view>
				<view :class="['content-title-btn',content.minimum>content.obtainedAmount?'active1':'active' ]"
					@click="tixian">
				</view>
			</view>
			<view class="content-txt">
				<view class="content-txt-tit"> 红包进度 </view>
				<view class="content-txt-card">
					<view class="content-txt-card-item " v-for="(t,k) in list1" :key="k">
						<image v-if="content.redEnvelopeRecord==(k+1)||content.redEnvelopeRecord>=(k+1)" class="img"
							src="https://images.linglinggong.net/static/icon3/xinrengongshihongbao/already.png" mode="">
						</image>
						<image v-else class="img"
							src="https://images.linglinggong.net/static/icon3/xinrengongshihongbao/wait.png" mode="">
						</image>
					</view>
				</view>
				<uni-section title="自定义图标" type="line" padding>
					<uni-steps :options="list1" active-icon="checkbox" :active="content.redEnvelopeRecord-1"
						activeColor="#FB4141" deactiveColor="#FEB07D" />
				</uni-section>
			</view>
		</view>
	</view>
</template>
<script>
	import myswiper from '../../components/beckhayu-swiper/my-swiper.vue'
	export default {
		components: {
			myswiper,
		},
		data() {
			return {
				content: {}, //全部数据
				list: ['提现35元', '提现2元', '提现222元'],
				active: 2,
				list1: [],
			}
		},
		onLoad() {
			this.getDetail()
		},
		methods: {
			// 返回上一页
			back() {
				uni.navigateBack();
			},
			//获取详情
			async getDetail() {
				let res = await this.$fetch(this.$api.query_newEmployee_detail, {}, 'GET')
				this.content = res.data
				this.list1 = this.content.redRecordList.map(v => {
					return {
						title: v.dictValue
					}
				})
			},
			// 提现
			async tixian() {
				let res = await this.$fetch(this.$api.newEmployee_detail_withdrawal, {}, 'GET')
				if (res.code == 500) {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					return
				}
				this.getDetail()
			}
		}
	}
</script>
<style lang="scss" scoped>
	.page {
		background: transparent;
		overflow: scroll;
		position: fixed;
		height: 100vh;
	}

	.content {
		width: 100%;
		min-height: 100%;
		background: url('https://images.linglinggong.net/XCX/new.png') center 0/cover no-repeat;
		border: 1rpx solid transparent;

		&-left {
			display: flex;
			padding-top: 13rpx;
			align-items: center;

			&>.img {
				width: 21rpx;
				height: 31rpx;
				margin-left: 26rpx;
			}
		}

		&-amount {
			height: 580rpx;
			text-align: center;
			font-size: 223rpx;
			font-family: Source Han Sans CN;
			font-weight: 500;
			color: #FFF8AE;
			margin-top: 360rpx;
		}

		&-swiper {
			display: flex;
			height: 61rpx;
			width: 382rpx;
			background: linear-gradient(270deg, #000000 0%, rgba(0, 0, 0, 0.05) 100%);
			margin-top: 101rpx;
			margin-left: auto;
			opacity: 0.5;

			&-item {
				font-size: 32rpx;
				width: 100%;
				height: 100%;
				position: absolute;
				display: flex;
				align-items: center;
				color: #fff;

				&>view {
					margin-left: 64rpx;
				}
			}
		}

		&-title {
			width: 750rpx;
			height: 831rpx;
			background: url(https://images.linglinggong.net/static/icon3/xinrengongshihongbao/2-2.png) center 0/cover no-repeat;
			margin-top: 75rpx;

			&-tip {
				display: flex;
				justify-content: space-between;

				&>view:nth-child(1) {
					margin-left: 82rpx;
					font-weight: 500;
					color: #FFFFFF;
					line-height: 51rpx;
					font-size: 40rpx;
					text-shadow: 0rpx 3rpx 0rpx rgba(213, 2, 0, 0.48);
					margin-top: 60rpx;
				}

				&>view:nth-child(2) {
					margin: 35rpx 152rpx 0 0;

					&>view:nth-child(1) {
						font-weight: 500;
						color: #FFFFFF;
						line-height: 32rpx;
						font-size: 32rpx;
						text-shadow: 0rpx 3rpx 0rpx rgba(213, 2, 0, 0.48);
					}

					&>view:nth-child(2) {
						width: 324rpx;
						height: 47rpx;
						font-size: 32rpx;
						background: linear-gradient(0deg, #FFF0B6 0%, #FFF9DF 100%);
						box-shadow: 0rpx 3rpx 7rpx 0rpx rgba(213, 2, 0, 0.35);
						border-radius: 5rpx;
						color: #D85A22;
						line-height: 47rpx;
						margin: 18rpx 0 0 0;
						padding-left: 32rpx;
					}
				}
			}

			&-pro {
				width: 702rpx;
				height: 453rpx;
				margin: 69rpx auto 0;
				background: url('https://images.linglinggong.net/XCX/redbag.png') center 0/cover no-repeat;
				display: flex;
				flex-direction: column;
				text-align: center;
				overflow: hidden;

				&>view:nth-child(1) {
					font-size: 36rpx;
					font-weight: 500;
					color: #FFFFFF;
					line-height: 39rpx;
					margin-top: 26rpx;
				}

				&>view:nth-child(2) {
					font-size: 120rpx;
					font-weight: bold;
					color: #FF3F38;
					line-height: 119rpx;
					margin-top: 30rpx;
				}

				&>view:nth-child(3) {
					font-size: 34rpx;
					font-weight: 500;
					color: #FFFFFF;
					margin-top: 145rpx;
				}
			}

			&-btn {
				width: 702rpx;
				height: 157rpx;
				margin: 0 auto;
			}

			.active {
				background: url(https://images.linglinggong.net/static/icon3/xinrengongshihongbao/active.png) center center/cover no-repeat;
			}

			.active1 {
				background: url(https://images.linglinggong.net/static/icon3/xinrengongshihongbao/active1.png) center center/cover no-repeat;
			}
		}

		&-txt {
			width: 750rpx;
			height: 786rpx;
			background: url(https://images.linglinggong.net/pro.png) center 0/cover no-repeat;
			overflow: hidden;

			&-tit {
				text-align: center;
				font-weight: bold;
				color: #FFFFFF;
				line-height: 39rpx;
				margin-top: 50rpx;
				font-size: 36rpx;
			}

			&-card {
				display: flex;
				justify-content: space-between;
				margin: 54rpx 56rpx 0;

				&-item {
					.img {
						width: 117rpx;
						height: 136rpx;
					}
				}
			}
		}
	}

	.content-swiper {
		margin-top: 0;
	}

	.content-left {
		position: fixed;
		top: 30rpx;
		display: flex;
		width: 100%;
	}
</style>